<template>
  <div class="category">
    <h3>{{ title }}分类</h3>
    <!-- 把games传给插槽 -->
    <slot :games="games" msg="hello">默认内容</slot>
    
  </div>
</template>

<script>
export default {
  name: 'Category',
  props: ['title'],
  data() {
    return {
      games: ['红色警戒', '穿越火线', '劲舞团', '超级玛丽'],
    };
  },
};
</script>

<style>
.category {
  background-color: #ccc;
  width: 200px;
  height: 300px;
}
h3 {
  text-align: center;
  background-color: aquamarine;
}
img {
  width: 100%;
}
</style>